<link href="/css/pagination.css" media="all" rel="stylesheet" type="text/css" />
<style type="text/css">
#admin_doc { width: 800px; margin: 20px 0px; } 
#admin_doc table tr th { text-align: center; background: #f7f7f7; }
#admin_doc table tr td { text-align: center; }
#admin_doc table tr td.left { text-align: left; }
#admin_doc table tr td a { color:#555; text-decoration: underline; background-color: transparent; }
#admin_doc table tr td a:hover { color:#ff0000; text-decoration: underline; }
</style>
<div id="admin_doc">
<h3>每日文章发布列表</h3>
<table class="table table-bordered">
	<tr>
		<th>用户</th>
		<th>标题</th>
		<th>字数</th>
		<th>发布日期</th>
		<th>更新日期</th>
	</tr>
	<% @doclist.each do |doc| %>
	<tr>
		<td><a href="javascript:void(<%=doc.userid%>);"><%=doc.user.name%></a></td>
		<td class="left"><a href="/doc/share/<%=doc.userid%>/<%=doc.id%>.html" target="_blank"><%=doc.title%></a>
			<% if(doc.stateid == 1) %><i class="icon-film"></i><% end %>
		</td>
		<td><%=doc.wordcount%></td>
		<td<% if(Time.now.in_time_zone(+8.hours).strftime('%Y-%m-%d') == doc.created_at.in_time_zone(+8.hours).strftime('%Y-%m-%d')) %> style="background-color:#FFFFCC;"<% end %>>
		<%=doc.created_at.in_time_zone(+8.hours).strftime('%Y-%m-%d %H:%M:%S') %></td>
		<td<% if(Time.now.in_time_zone(+8.hours).strftime('%Y-%m-%d') == doc.updated_at.in_time_zone(+8.hours).strftime('%Y-%m-%d')) %> style="background-color:#FFFFCC;"<% end %>>
		<%=doc.updated_at.in_time_zone(+8.hours).strftime('%Y-%m-%d %H:%M:%S') %></td>
	</tr>
	<% end %>
</table>

<div class='flickr_pagination' style="text-align:left;"><%= will_paginate @doclist, :previous_label => '上页', :next_label => '下页' %></div>
</div>
<script type="text/javascript">


$().ready(function(){

	$.ajaxSetup({  
	    beforeSend: function(xhr) {  
	        xhr.setRequestHeader("X-CSRF-Token", $("meta[name=\"csrf-token\"]").attr("content"));  
	    }  
	});	


});
</script>